<script>
/*
 * @Author: wzh 
 * @Date: 2020-12-28 13:58:32 
 * @Last Modified by: 1521620993@qq.com
 * @Last Modified time: 2020-12-28 14:16:23
 */
</script>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>03-子盒子的外边距</title>
</head>
<body>
  <style>
    .parent{
      width: 300px;
      height: 200px;
      background-color: wheat;
      background-clip: content-box;
      padding: 10px;
      border: 10px dashed red;
      margin: 0 auto;
    }
    .child{
      height: 100px;
      background-color: red;
      background-clip: content-box;
      padding: 10px;
      border: 10px dashed blue;
      width: 100px;
      width: auto;
      margin: 0 auto;
      margin: 0 -60px;
    }
  </style>
  <div class="parent">
    <div class="child"></div>
  </div>
</body>
</html>